<template lang="html">
  <div class="like">
    <div class="likeTitle border-bottom">猜你喜欢</div>
    <div class="item border-bottom" v-for="(item, index) of likelist" :key="index">
      <img class="left" :src="item.imgSrc">
      <div class="right">
        <p class="title">{{item.title}}</p>
        <p class="desc">{{item.desc}}</p>
        <p class="price">
          <span class="newprice">{{item.newprice}}</span>
          <span class="yuan">元</span>
          <span class="oldprice">门市价:{{item.oldprice}}元</span>
        </p>
      </div>
      <p class="sold">已售{{item.sold}}</p>
    </div>
    <div class="more border-bottom">查看全部团购</div>
  </div>
</template>

<script>
export default {
  name: 'HomeLike',
  data () {
    return {
      likelist: [{
        imgSrc: 'http://p0.meituan.net/200.0/deal/b7892297e0fb273ed3b7151d483e647731242.jpg@120_0_400_400a%7C267h_267w_2e_100q',
        title: '功福咖小蹄大作',
        desc: '[5店通用]烤猪蹄1份，包间免费',
        newprice: 14.9,
        oldprice: 16,
        sold: 21830
      }, {
        imgSrc: 'http://p0.meituan.net/200.0/deal/b7892297e0fb273ed3b7151d483e647731242.jpg@120_0_400_400a%7C267h_267w_2e_100q',
        title: '功福咖小蹄大作',
        desc: '[5店通用]烤猪蹄1份，包间免费',
        newprice: 14.9,
        oldprice: 16,
        sold: 21830
      }, {
        imgSrc: 'http://p0.meituan.net/200.0/deal/b7892297e0fb273ed3b7151d483e647731242.jpg@120_0_400_400a%7C267h_267w_2e_100q',
        title: '功福咖小蹄大作',
        desc: '[5店通用]烤猪蹄1份，包间免费',
        newprice: 14.9,
        oldprice: 16,
        sold: 21830
      }, {
        imgSrc: 'http://p0.meituan.net/200.0/deal/b7892297e0fb273ed3b7151d483e647731242.jpg@120_0_400_400a%7C267h_267w_2e_100q',
        title: '功福咖小蹄大作',
        desc: '[5店通用]烤猪蹄1份，包间免费',
        newprice: 14.9,
        oldprice: 16,
        sold: 21830
      }, {
        imgSrc: 'http://p0.meituan.net/200.0/deal/b7892297e0fb273ed3b7151d483e647731242.jpg@120_0_400_400a%7C267h_267w_2e_100q',
        title: '功福咖小蹄大作',
        desc: '[5店通用]烤猪蹄1份，包间免费',
        newprice: 14.9,
        oldprice: 16,
        sold: 21830
      }]
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import '~styles/mixins.styl'
  .like
    margin-top: .2rem
    margin-left: .2rem
    background: #F0EFED
    .likeTitle
      padding: .28rem .2rem .2rem 0
      background: #fff
      font-size: .32rem
    .item
      position: relative
      background: #fff
      overflow: hidden
      padding: .28rem .2rem .28rem 0
      .left
        float: left
        width: 1.8rem
        height: 1.8rem
        margin-right: .2rem
      .right
        float: left
        .title
          padding-top: .1rem;
          margin-bottom: .12rem;
          font-size: .3rem;
          font-weight: 400;
          color: #333;
          ellipsis()
        .desc
          font-size: .24rem;
          height: .68rem;
          margin-bottom: .16rem;
          color: #666;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          overflow: hidden;
          ellipsis()
        .price
          position: absolute;
          width: 100%;
          bottom: .28rem;
          .newprice
            font-size: .38rem;
            color: #06c1ae;
          .yuan
            font-size: .26rem;
            color: #06c1ae;
            margin-left: -.08rem
          .oldprice
            font-size: .24rem;
            color: #666;
      .sold
        position: absolute
        right: .2rem
        bottom: .28rem
        font-size: .24rem;
        color: #666
    .more
      color: #06c1ae;
      background: #fff
      position: relative;
      padding-right: .3rem;
      width: 100%;
      box-sizing: border-box;
      height: .8rem;
      line-height: .8rem;
      font-size: .3rem;
</style>
